/*
*   VSize 用于监视元素的 宽高属性
*   @param 需要传递一个函数来接收监视到的宽高
* */
export const VSize = {
    mounted(el, binding, vnode, prevVnode) {
        let byId = document.getElementById(el.id);
        let w: number = byId!.offsetWidth
        let h: number = byId!.offsetHeight
        let func = binding.value
        func(w, h)
    },
    updated(el, binding, vnode, prevVnode) {
        let byId = document.getElementById(el.id);
        let w: number = byId!.offsetWidth
        let h: number = byId!.offsetHeight
        let func = binding.value
        func(w, h)
    }
}